@include('admin.public.head')
@include('admin.public.pop')

<style type="text/css">
    .inner_btn {
        background: #19a97b;
        color: white;
        padding: 5px 8px;
        border-radius: 2px;
    }

    .ibox-title{
        float: left;
    }
    .class_base{
        position: relative;
        width: 70%;
        height: 200px;
        overflow-x: hidden;
        overflow-y: scroll;
        text-align: left;
        margin-bottom-bottom: 15px;
        float: left;
        margin-bottom: 15px;
        margin-top: 15px;
        font-size:14px
    }
    .class_base p{
        font-weight: bold;
    }
    .class_base p span{
        color:red;
    }
    .class_base::-webkit-scrollbar{
        display: none;
    }
    .span_c{
        padding-right: 20px;
    }
</style>

<div class="ibox-title">
    <h5>camp管理</h5>
</div>

<div class="ibox-content">
    @if(permission('/camp_add', $user['right_list'], $user['get_routes']))
    <div class="row">
        <div class="col-sm-12 clear">
            <div class="" style="margin: 15px 10px">
                <a href="/camp_add" class="btn btn-w-m btn-primary">新增</a>
            </div>
        </div>
    </div>
    @endif

    <div class="row">
        <div class="col-sm-12 pull-right m-b-xs">
            <form action="">
                <div class="col-sm-1  m-b-xs text-center pull-right">
                    <button type="submit" class="btn btn-sm btn-primary">搜索</button> </span>
                </div>

                <div class="col-sm-2 text-center pull-right">
                    <input type="text" name="group_class_name" value="{{$group_class_name}}" placeholder="團購商品名稱" class="input form-control">
                </div>

                @include('admin.public.store.where_select')

            </form>
        </div>
    </div>

    <table class="table table-bordered">
        <thead>
            <tr>
                <th>門店名稱</th>
                <th>团购商品名称</th>
                <th>需要多少积分购买</th>
                <th>购买（预约）量</th>
                <th>封面</th>
                <th>操作</th>
            </tr>
        </thead>
        <tbody>
        @foreach ($result as $v)
            <tr>
                <td>{{$v->store->store_name??''}}</td>
                <td>{{$v->group_class_name}}</td>
                <td>{{$v->group_class_price}}</td>
                <td>{{$v->buy_number}}</td>
                <td><img src="{{$v->cove_img}}" width="100" height="100"></td>
                <td>
                    @if(permission('/camp_info', $user['right_list'], $user['get_routes']))
                    <div class="btn-group">
                        <a  class="btn btn-primary btn-sm dropdown-toggle" href="javascript:void(0)" url="/camp_info/{{$v->id}}" onclick="toggle($(this), '100%', '100%',  'Trx初階班')">查看课程安排
                        </a>&nbsp;&nbsp;
                    </div>
                    @endif

                    @if(permission('/camp_edit', $user['right_list'], $user['get_routes']))
                    <div class="btn-group">
                        <a  class="btn btn-primary btn-sm dropdown-toggle" href="/camp_edit/{{$v->id}}">編輯
                        </a>&nbsp;&nbsp;
                    </div>
                    @endif

                    @if(permission('/camp_del', $user['right_list'], $user['get_routes']))
                    <div class="btn-group">
                        <a  class="btn btn-primary btn-sm dropdown-toggle" href="javascript:void(0)" onclick="del($(this))" url="/camp_del/{{$v->id}}">刪除
                        </a>&nbsp;&nbsp;
                    </div>
                    @endif
                </td>
            </tr>
        @endforeach
        </tbody>
        {{ $result->appends(Request::except('page'))->links() }}
    </table>
    {{ $result->appends(Request::except('page'))->links() }}
</div>

